﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kokomo.Mirror.CliMetadata.Signatures
{
	public class CustomModifiers
	{
		public int[] RequiredModifierTypeTokens { get; set; }
		public int[] OptionalModifierTypeTokens { get; set; }

		public override bool Equals(object obj)
		{
			CustomModifiers other = obj as CustomModifiers;
			if (other == null) return false;

			bool equals =
				(this.RequiredModifierTypeTokens != null)
				&& (this.OptionalModifierTypeTokens != null)
				&& (other.RequiredModifierTypeTokens != null)
				&& (other.OptionalModifierTypeTokens != null)
				&& (this.RequiredModifierTypeTokens.SequenceEqual(other.RequiredModifierTypeTokens))
				&& (this.OptionalModifierTypeTokens.SequenceEqual(other.OptionalModifierTypeTokens))
				;
			return equals;
		}
		public override int GetHashCode()
		{
			int hash = 0;
			if (this.RequiredModifierTypeTokens != null)
				hash ^= this.RequiredModifierTypeTokens.Length;
			return hash;
		}
	}
}
